<?php
declare (strict_types = 1);

namespace app\common\validate;

use think\Validate;
class StudentEntrustedDetail extends Validate
{
    protected $rule = ['entrusted_id' => 'require|number','student_id' => 'require|number','medication_name' => 'require','save_type' => 'require','medication_num' => 'require|number','medication_unit' => 'require','medication_image' => 'require','medication_explain' => 'require',
    ];

    protected $message = ['entrusted_id.require' => '委托id为必填项','entrusted_id.number' => '委托id需为数字','student_id.require' => '学生ID为必填项','student_id.number' => '学生ID需为数字','medication_name.require' => '药品名称为必填项','save_type.require' => '保存方式为必填项','medication_num.require' => '服用数量为必填项','medication_num.number' => '服用数量需为数字','medication_unit.require' => '药品单位为必填项','medication_image.require' => '上传图片为必填项','medication_explain.require' => '特别说明为必填项',
    ];

    /**
     * 添加
     */
    public function sceneAdd()
    {
        return $this->only(['entrusted_id','student_id','medication_name','save_type','medication_num','medication_unit','medication_image','medication_explain',]);
    }

    /**
     * 编辑
     */
    public function sceneEdit()
    {
        return $this->only(['entrusted_id','student_id','medication_name','save_type','medication_num','medication_unit','medication_image','medication_explain',]);
    }
}
